<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class SubTaskLog extends Model
{
    use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
    use HasFactory, SoftDeletes;

    const OPERATION_PUBLISH = 'publish';
    const OPERATION_REPORT = 'report';
    const OPERATION_REVIEW1 = 'review1';
    const OPERATION_REJECT1 = 'reject1';
    const OPERATION_REVIEW2 = 'review2';
    const OPERATION_REJECT2 = 'reject2';

    protected $hidden = ['deleted_at'];

    public function operator()
    {
        return $this->belongsTo(User::class, 'operator_id')->select(['id', 'name', 'phone', 'district_id']);
    }
}
